package com.edu.neusoft.student.domain;

import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;

@Data
public class Orderdetail {

    @NotNull(message = "OrderDetail ID cannot be null")
    private Integer orderdetailid;

    @NotNull(message = "Order ID cannot be null")
    @Min(value = 1, message = "Order ID must be greater than 0")
    private Integer orderid;

    @NotNull(message = "Car ID cannot be null")
    @Min(value = 1, message = "Car ID must be greater than 0")
    private Integer carid;

    @NotNull(message = "Quantity cannot be null")
    @Min(value = 1, message = "Quantity must be at least 1")
    private Integer quantity;

    @NotNull(message = "Price cannot be null")
    @DecimalMin(value = "0.01", inclusive = true, message = "Price must be at least 0.01")
    private BigDecimal price;
}
